<script setup lang="ts">
import { useRoute, useRouter } from 'vue-router';

const route = useRoute()
const router = useRouter()
</script>

<template>
  <div class="detail">
    <h1>文章详情页</h1>
    <p>当前文章的id：{{ route.params }}</p>
    <p>当前文章的id：{{ $route.params }}</p>
    <button @click="router.push('/')">返回首页</button>
    <button @click="$router.push('/')">返回首页</button>
  </div>
</template>

<style scoped>
.detail {
  width: 100%;
  height: 500px;
  background-color: pink;
}
</style>